#/bin/sh
#usage CopyFilesToSlave.sh <GR working dir> <Slave SSH User> <Slave SSH host> <Slave destination dir>
cd $1
newest=`ls -t SGR.export*.zip| sed "s:^:$1/:"|head -1`
if [ "${newest}" == "" ]; then
    echo "no file need to copy"
    exit 1
else
    scp $newest $2@$3:$4
fi